package com.codepilot.server.converter;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import com.codepilot.server.model.dto.ProblemDTO;
import com.codepilot.server.model.entity.LeecodeProblem;
import com.codepilot.server.model.entity.OpenjudgeProblem;
import com.codepilot.server.model.vo.ProblemVO;

@Mapper
public interface ProblemConverter {

    ProblemConverter INSTANCE = Mappers.getMapper(ProblemConverter.class);

    @Mapping(target = "source", expression = "java(\"LC\")")
    ProblemDTO leecode2ProblemDTO(LeecodeProblem leecodeProblem);

    @Mapping(target = "source", expression = "java(\"OJ\")")
    ProblemDTO openjudge2ProblemDTO(OpenjudgeProblem openjudgeProblem);

    ProblemVO problemDTO2ProblemVO(ProblemDTO problemDTO);

}
